﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>计算字符串的长度</title>
</head>
<body>
    <script>
        let txt = "Hello JavaScript!";
        document.write("字符串“Hello JavaScript!”的长度为：" + txt.length);
    </script>
</body>
</html>
